<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<div class="popup-header">
		<h1>录入车主信息</h1>
		<i class="mid"></i>
		<a class="btn btn-normal" onclick="save();">确定</a>
		<a class="btn btn-return" onclick="close_popup();">取消</a>
	</div>
	<div class="popup-body">
		<div class="popup-body-scroll">
			<div class="popup-content">
				<php>
					if (!$check_auth) {
				</php>
				<form id="form_data" name="form_data" method="post" >
					<input type="hidden" name="qrcode" id="qrcode"  value="{$qrcode}">
					<input type="hidden" name="opmode" id="opmode" value="check">
					<div class="box">
						<label class="input-label" for="short">密码*：</label>
						<input class="input w19" type="password" name="pwd" check="required" info="请输入密码" >
					</div>
				</form>
				<php>
					}else{
				</php>
				<form id="form_data" name="form_data" method="post" >
					<input type="hidden" name="qrcode" id="qrcode" value="{$qrcode}">
					<input type="hidden" name="opmode" id="opmode" value="{$opmode}">
					<div class="box">
						<label class="input-label" for="name">称呼：</label>
						<input class="input w19" type="text" id="name" name="name" check="required" info="请输入称呼" value="{$vo.name}">
					</div>
					<div class="box">
						<label class="input-label" for="tel">联系方式：</label>
						<input class="input w19" type="text" id="tel" name="tel" check="required" info="请输入联系方式" value="{$vo.tel}">
					</div>
					<div class="box">
						<label class="input-label" for="short">密码*：</label>
						<input class="input w19" type="password" id="pwd" name="pwd" check="required" info="请输入密码" value="{$vo.pwd}">
					</div>
					<div class="box" style="padding: 0px;margin: 0px;">
						<label class="input-label" for="short">确认密码*：</label>
						<input class="input w19" type="password" id="pwd2" name="pwd2" check="required" info="请输入确认密码"  value="{$vo.pwd}">
					</div>
					<div class="box" >
						<label class="input-label" for="name"></label>
						<span>用于修改车主信息时验证</span>
					</div>
				</form>
				<php>
					}
				</php>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var fn = {
				save : function() {
					$pwd1 = $("#pwd").val();
					$pwd2 = $("#pwd2").val();
					if ($pwd1 != $pwd2) {
						layer.msg('密码不一致');
						return false;
					}
					send_form('form_data', '{:url("save")}', '', function(ret) {
						if (ret.status == 1) {
							parent.layer.msg(ret.info, {
								time : 1200
							}, function() {
								location.reload(true);
							});
						} else {
							parent.layer.msg(ret.info);
							return false;
						};
					});
				},
				close_popup : function() {
					parent.layer.close(index);
				},
				select_pid : function() {
					winopen("{:url('select_pid')}", 560, 470);
				},
			};
			win_exp(fn);
		});
	</script>
</block>